package com.medord.flow;

import com.medord.dao.StudentDao;
import com.medord.entity.Student;
import com.medord.machine.core.FlowConstant;
import com.medord.machine.core.annotition.StateService;
import com.medord.machine.core.FlowState;
import com.medord.machine.core.annotition.TargetStateMethod;
import com.medord.machine.core.entity.ICurrentStateDto;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @author 孙丰佳
 * @version V1.0
 * @Title: Cd21State
 * @Package com.medord.machine.core
 * @Description: (用一句话描述该文件做什么)
 * @date 2021-08-01 15:39
 **/
@StateService(flowName = FlowConstant.MED_FLOW_NAME, state = FlowConstant.CD_21, stateDes = FlowConstant.NA_21)
public class Cd21State extends FlowState {
    @Autowired
    private StudentDao studentDao;

    @TargetStateMethod(target = FlowConstant.CD_11)
    public String toCd11State(ICurrentStateDto iCurrentStateDto) {
        Student student = (Student) iCurrentStateDto.get();
        student.setStatus(FlowConstant.CD_11);
        studentDao.updateStudent(student);
        return null;
    }

    @TargetStateMethod(target = FlowConstant.CD_81)
    public String toCd81State(ICurrentStateDto iCurrentStateDto) {
        return null;//"到了11状态";
    }
}
